"""
目标：给定列表，返回顺序查找成功元素的索引
示例：sequence=[99,12,33,74,521,13,14], target=521
"""


def sequence_search(array, n):
    length = len(array)
    for i in range(length):
        if array[i] == n:
            return i
    return -1


sequence = [99, 12, 33, 74, 521, 13, 14]
target = 521
print(sequence_search(sequence, target))
